From 6a89fed7f67ed9a854a26c8d77d651e0fc26b853 Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Tue, 31 May 2005 15:20:00 +0000 Subject: [PATCH] bitkeeper revision 1.1614 (429c80a0GOB6P2mG94bxVMLZE34VdA) XendDomainInfo.py: g/c vif_up: it's the guest's responsibility to take appropriate actions to get its network working again, i.e. send ARP packets when it's resumed. Signed-off-by: Christian Limpach --- tools/python/xen/xend/XendDomainInfo.py | 33 ------------------------- 1 file changed, 33 deletions(-) diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 4d05822e5d..2d9b52e67c 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -93,38 +93,6 @@ def shutdown_reason(code): """ return shutdown_reasons.get(code, "?") -def vif_up(iplist): - """send an unsolicited ARP reply for all non link-local IP addresses. - - @param iplist: IP addresses - """ - - IP_NONLOCAL_BIND = '/proc/sys/net/ipv4/ip_nonlocal_bind' - - def get_ip_nonlocal_bind(): - return int(open(IP_NONLOCAL_BIND, 'r').read()[0]) - - def set_ip_nonlocal_bind(v): - print >> open(IP_NONLOCAL_BIND, 'w'), str(v) - - def link_local(ip): - return xen.util.ip.check_subnet(ip, '169.254.0.0', '255.255.0.0') - - def arping(ip, gw): - cmd = '/usr/sbin/arping -A -b -I eth0 -c 1 -s %s %s' % (ip, gw) - log.debug(cmd) - os.system(cmd) - - gateway = xen.util.ip.get_current_ipgw() or '255.255.255.255' - nlb = get_ip_nonlocal_bind() - if not nlb: set_ip_nonlocal_bind(1) - try: - for ip in iplist: - if not link_local(ip): - arping(ip, gateway) - finally: - if not nlb: set_ip_nonlocal_bind(0) - config_handlers = {} def add_config_handler(name, h): @@ -244,7 +212,6 @@ def vm_restore(src, progress=False): except Exception, ex: raise VmError('config error: ' + str(ex)) vm.dom_construct(dom, config) - vif_up(vm.ipaddrs) return vm def dom_get(dom): -- 2.30.2